package com.example.springrest1.repository;

import com.example.springrest1.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;

@RepositoryRestResource(path = "user")
public interface UserRepository extends JpaRepository<User,Long> {
    @RestResource(path = "nameStartsWith", rel = "nameStartsWith")
    User findByNameStartsWith(@Param("name") String name);

}
